package com.kai.steering.data.service.entity.po;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.kai.steering.data.service.entity.domainObject.QuestionDetailsDO;
import com.kai.steering.data.service.entity.domainObject.UserQuestionDO;
import lombok.*;

import java.io.Serializable;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ToString
@EqualsAndHashCode(callSuper = false)
@TableName(value = "user_question")

public class UserQuestion  implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * id
     */
    @TableId(value = "user_question_id", type = IdType.ASSIGN_UUID)
    private String userQuestionId;
    /**
     * 用户id
     */
    private String userId;
    /**
     * 题目id
     */
    private String questionId;
    /**
     * 收藏
     */
    private String collection;
    /**
     * 做题次数
     */
    private Integer problemNumber;
    /**
     * 错误次数
     */
    private Integer errorNumber;
    /**
     * 笔记id
     */
    private String noteId;
    /**
     * 存在0删除1
     */
    private Integer usable;
    /**
     * 删除日期
     */
    private Date deleteDatetime;

    public UserQuestion(UserQuestionDO userQuestionDO) {
        convertQuestion(userQuestionDO);
    }
    public UserQuestion  convertQuestion(UserQuestionDO userQuestionDO) {
        BeanUtil.copyProperties(userQuestionDO, this);
        return this;
    }
}
